#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'

void solve() {
	int n; cin >> n;
	vector<int> a(n + 1);
	ll sum = 0;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		sum += a[i];
	}
	ll x = sum / n;
	ll res = 0;
	int f = 0;
	for (int i = 1; i <= n; i++) {
		if (a[i] == x) continue;
		if (a[i] > x) res += a[i] - x;
		if (a[i] < x) {
			ll y = x - a[i];
			if (res < y) {
				f = 1;
				break;
			}else {
				res -= y;
			}
		}
	}
	if (f) cout << "NO" << endl;
	else cout << "YES" << endl;
}

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int t; cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}